#include <bits/stdc++.h>
#ifndef DEBUG
#define debug
#endif
using namespace std;
using i64 = int64_t;

int main() {
  cin.tie(0)->sync_with_stdio(0);
  int n, v, x0;
  while (cin >> n >> v >> x0) {
    if (n == 0) break;
    vector<tuple<int, int, int>> a(n + 1);
    for (int i = 1; i <= n; i ++) {
      auto& [x, c, d] = a[i];
      cin >> x >> c >> d;
    }
    sort(a.begin() + 1, a.end());
    vector<int> x(n + 1), c(n + 1), d(n + 1), sum(n + 1);
    for (int i = 1; i <= n; i ++) {
      x[i] = get<0>(a[i]);
      c[i] = get<1>(a[i]);
      d[i] = get<2>(a[i]);
    }
    partial_sum(d.begin(), d.end(), sum.begin());
    vector<vector<array<double, 2>>> dp(n + 1, vector<array<double, 2>>(n + 1, {1e9, 1e9}));
    for (int l = n; l >= 1; l --) {
      dp[l][l][0] = dp[l][l][1] = fabs(x[l] - x0) / v * sum[n];
      for (int r = l + 1; r <= n; r ++) {
        double totalv = sum[n] - sum[r] + sum[l];
        dp[l][r][0] = min(
          dp[l + 1][r][0] + fabs(x[l + 1] - x[l]) / v * totalv,
          dp[l + 1][r][1] + fabs(x[r] - x[l]) / v * totalv
        );
        totalv = sum[n] - sum[r - 1] + sum[l - 1];
        dp[l][r][1] = min(
          dp[l][r - 1][0] + fabs(x[r] - x[l]) / v * totalv,
          dp[l][r - 1][1] + fabs(x[r] - x[r - 1]) / v * totalv
        );
      }
    }
    cout << fixed << setprecision(0);
    cout << floor(min(dp[1][n][0], dp[1][n][1]) + accumulate(c.begin(), c.end(), 0.0)) << endl;
  }
}